package com.realgodo.site.entity.application.communication;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import com.realgodo.site.entity.IdEntity;
import com.realgodo.site.entity.space.Space;


@Entity(name = "Communication")
@Inheritance(strategy = InheritanceType.JOINED)
@Table(name = "communication")
public class Communication extends IdEntity{

	/***/
	private static final long serialVersionUID = 3420425748723689968L;
	
	private Date pubTime = new Date();
	
	/**回复,评论from*/
	private Space publisher;
	
	/**内容*/
	private String content;
	
	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "pub_time", insertable = true, updatable = true)
	public Date getPubTime() {
		return pubTime;
	}

	public void setPubTime(Date pubTime) {
		this.pubTime = pubTime;
	}
	
	@ManyToOne
	@JoinColumn(name = "publisher_id", referencedColumnName = "id", nullable = false)
	public Space getPublisher() {
		return publisher;
	}

	public void setPublisher(Space publisher) {
		this.publisher = publisher;
	}

}
